<?php
    class DBManager{

        private $db_host = "localhost";
		private $db_name = "opoller";
		private $db_user = "root";
		private $db_pass = "";
        private $db_link;

        function __construct(){
            $this->connect();
        }

        private function connect()
        {
            $this->db_link = mysql_connect($this->db_host, $this->db_user, $this->db_pass);
            if(!$this->db_link) die("Error al conectarse al motor de base de datos");

            if(!mysql_select_db($this->db_name)) die("Error al conectarse a la base de datos");
            
        }

        public static function mysql_fetch_assoc_all($res)
	{
			while($filas[] = mysql_fetch_assoc($res)){}

			array_pop($filas);
			return $filas;
	}
        

    }
?>
